<template>
  <div class="case-card-item">
    <div class="header-panel flex-between-center">
      <div class="msg flex-1 flex-start-center">
        <span class="status-block" :class="'color-'+obj.status" ></span>
        <img :src="userDefault" alt="">
        <span class="fs-16">{{obj.name}}</span>
      </div>
      <div class="no">工号：{{obj.no}}</div>
    </div>
    <div class="content-panel fs-12">
      <div class="content-row flex-start-center">
        <span class="mr-5">状态:</span>
        <span>{{obj.statusName}}</span>
        <img v-if="obj.status === 1" class="ml-5 w-25 h-20" :src="close"/>
        <img v-else-if="obj.status === 2" class="ml-5 w-30 h-25" :src="work"/>
        <img v-else class="ml-5 w-25 h-20" :src="wait"/>
      </div>
      <div class="content-row">
        <span class="mr-5">在线时长:</span>
        <span>{{obj.time}}</span>
      </div>
      <div class="content-row">
        <span class="mr-5">操作:</span>
        <span>
          <el-button type="text">离线</el-button>
           <el-divider direction="vertical"/>
          <el-button type="text">监听</el-button>
           <el-divider direction="vertical"/>
          <el-button type="text">耳语</el-button>
           <el-divider direction="vertical"/>
          <el-button type="text">强拆</el-button>
        </span>
      </div>
    </div>
  </div>
</template>

<script>
import userDefault from '@/assets/images/user-default.png'
import close from '@/assets/images/close.png'
import wait from '@/assets/images/wait.png'
import work from '@/assets/images/work.png'

  export default {
    name: 'CaseCardItem',
    props:{
      obj: {
        type: Object,
        default: ()=> {}
      }
    },
    data(){
      return {
        userDefault, close, wait, work
      }
    }
  }
</script>

<style lang="scss" scoped>
.case-card-item{
  width: 300px;
  height: 210px;
  background: url(./../../assets/images/card-bg.png) no-repeat center center;
  background-size: 100% 100%;
  padding: 15px 20px;
  .content-panel{
    padding: 20px 8px 10px 8px;
    color: #535353;
    .content-row{
      height: 30px;
      line-height: 30px;
    }
  }
  .status-block{
    position: absolute;
    left: 43px;
    top: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    &.color-1{// close
      background: #919191;
      box-shadow: 0px 4px 7px 3px rgba(255, 162, 1, 0.19);
    }
    &.color-2{// work
      background: #FFA201;
      box-shadow: 0px 4px 7px 3px rgba(145, 145, 145, 0.19);
    }
    &.color-3{// wait
      background: #31A41A;
      box-shadow: 0px 4px 7px 3px rgba(255, 162, 1, 0.19);
    }
  }
  .header-panel{
    .msg{
      position: relative;
      img{
        width: 60px;
        height: 60px;
      }
      span{
        color: #555;
        padding-left: 10px;
      }
    }
    .no{
      color: #fff;
    }

  }
}
</style>